from openai import OpenAI

client = OpenAI(
    base_url = "http://192.168.31.248:8000/v1",
    api_key="g01wN4cdCRIM3tjaEd788fC4CcF14734B989E677CaBe66C7-4",
)

chat_completion = client.chat.completions.create(
    messages=[
        {
            "role": "user",
            "content": "你好呀,讲个笑话",
        }
    ],
    model="chatglm3_6b",
)
print(chat_completion)